cmake_minimum_required(VERSION 3.17)
project(add_exe_7)

add_executable(main main.cpp)

add_executable(mytest ALIAS main)

if (TARGET mytest)
	message(STATUS "alias mytest is used in if")
endif()

set_property(TARGET main PROPERTY NEW_PROPERTY "This is new property")
#set_property(TARGET mytest PROPERTY NEW_PROPERTY "This is new property")
get_property(var TARGET main PROPERTY NEW_PROPERTY)
message(STATUS "NEW_PROPERTY by main = ${var}")
get_property(var1 TARGET mytest PROPERTY NEW_PROPERTY)
message(STATUS "NEW_PROPERTY by mytest = ${var1}")

add_executable(myecho IMPORTED GLOBAL)
set_property(TARGET myecho PROPERTY IMPORTED_LOCATION "/usr/bin/echo")
add_executable(alias_myecho ALIAS myecho)
add_custom_command(OUTPUT custom_command COMMAND alias_myecho "output from myecho alias")
add_custom_target(custom_target DEPENDS custom_command)
